<h1>Tạo khách hàng mới</h1>

<?php echo $this->Form->create('Customer', array('action' => 'add')); ?>
<table class="table2">
    <tr>
        <td>Họ và tên đệm <span class="compulsory">*</span></td>
        <td>
            <?php echo $this->Form->input('Customer.last_name', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?>
        </td>
    </tr>
    <tr>
        <td>Tên <span class="compulsory">*</span></td>
        <td>
            <?php echo $this->Form->input('Customer.first_name', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?>
        </td>
    </tr>
    <tr>
        <td>ĐT <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Customer.telephone', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?></td>
    </tr>
    <tr>
        <td>Email <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Customer.email', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?></td>
    </tr>
    <tr>
        <td>Địa chỉ</td>
        <td><?php echo $this->Form->input('Customer.address', array('type' => 'text', 'class' => 'textfield', 'label' => false)); ?></td>
    </tr>
    <tr>
        <td>Mã khách</td>
        <td>
            <?php echo $this->Form->input('Customer.code', array('type' => 'hidden', 'value' => $customer_code, 'class' => 'textfield', 'label' => false)); ?>
            <?php //echo $this->element('barcode', array('data_to_encode' => $customer_code)); ?>
            <span class="code"><?php echo $customer_code; ?></span>
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td>
            <?php echo $this->Form->submit('Tạo mới', array('class' => 'button', 'div' => false)); ?>
            <?php echo $this->Form->submit('Hủy', array('class' => 'button', 'onclick' => "return back_to_index()", 'div' => false)); ?>
            <script type="text/javascript">
            function back_to_index()
            {
                window.location = '<?php echo $this->Html->url(array('controller' => 'customers', 'action' => 'index')) ?>';
                return false;
            }
            </script>
        </td>
    </tr>
</table>
<?php echo $this->Form->end(); ?>